package bean;

import java.sql.Connection;
import java.sql.DriverManager;

public class MyOracle {
	Connection  conn;//반환하는게 가장중요...
	
	
	public MyOracle(){
		String driver= "oracle.jdbc.driver.OracleDriver";
		String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String id = "hr";
		String pwd = "hr";
		
		try{
			Class.forName(driver);
			System.out.println("드라이버가 로딩됨");
			conn = DriverManager.getConnection(url,id,pwd);
			System.out.println("connection생성...");		
		}catch(Exception ex){
			ex.printStackTrace();
		}
		
	}
	public Connection getConn() {
		return conn;
	}
	public static void main(String[] args) {
		MyOracle  mo = new MyOracle();

	}

}
